{% extends 'cms/base.html'%}

{% block title %}新闻列表{% endblock %}

{% block head %}
	<style>
		.form-control {
			margin-right: 100px;
		}
		
		#button {
			margin-left: 600px;
		}
	</style>
{% endblock %}

{% block content-header %}
  <h1>新闻管理</h1>
{% endblock %} 

{% block content %}
<div class="row">
	<div class="col-md-12">
		<div class="box box-primary">
			<div class="box-header">
				<form action="" method='post' class="form-inline">
					{% csrf_token %}
					<div class="form-group">
						<label for="author">手机号</label>
						<input type="text" name="telephone" id='telephone' class="form-control">
						<label for="username">用户名：</label>
						<input type="text" name="username" id='username' class="form-control">
						<label for="group">所属分组：</label>
						<select name="group" id="group" class="form-control">
							{% for category in categories %}
								<option value={{category.id}}>{{category.name}}</option>
							{% endfor %}
						</select>
						<button class="btn btn-primary" id="button">查询</button>
					</div>
				</form>
			</div>
			<div class="box-body ">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th>手机号</th>
							<th>用户名</th>
							<th>所属分组</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						{% for user in users %}
							<tr>							
								<td>{{user.telephone}}</td>
								<td>{{user.username}}</td>
								<td>超级管理员</td>
								<td><a href="{% url 'xfzauth:delete_staff' user_id=user.pk %}"><button class="btn btn-danger btn-xs">删除</button></a></td>
							</tr>
						{% endfor %}
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
{% endblock %} 